package com.yxq.mdt.app.modules.personal.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.modules.goodsdetail.bean.CollectGoodsBean;

import java.util.List;

/**
 * @author L
 * @time 2019-11-19
 * @describe 收藏商品列表
 */
public class CollectGoodsListAdapter extends BaseQuickAdapter<CollectGoodsBean.ListBean, BaseViewHolder> {

    public CollectGoodsListAdapter(int layoutResId, @Nullable List<CollectGoodsBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CollectGoodsBean.ListBean item) {
        GlideHelper.setLoadRoundImage(mContext, item.getGoods_pic(), R.color.gray, helper.getView(R.id.order_confirm_goods_list_iv_img));
        helper.setText(R.id.cart_tv_name, item.getName());
        helper.setText(R.id.cart_tv_price, String.format("￥%.2f", item.getPrice()));
    }

}
